<table class="table">
  <thead>
  <tr>
    <td>
      <button type="button" class="btn btn-primary" (click)="add()">添加</button>
    </td>

  </tr>
  <tr>
    <th scope="col">#</th>
    <th scope="col">封面图片</th>
    <th scope="col">新闻标题</th>
    <th scope="col">作者</th>
    <th scope="col">发布时间</th>
    <th scope="col">目录</th>
    <th scope="col">操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let n of nl let i=index">
    <th scope="row">{{i+1}}</th>
    <td> <img width="100px" height="100px" *ngIf="n.coverpic!=null" src="{{config.IMG_HOST}} {{n.coverpic}}"/> </td>
    <td>{{n.title}}</td>
    <td>{{n.author}}</td>
    <td>{{n.pbdate |date:'yyy-MM-dd HH:mm'}}</td>
    <td>{{n.cate}}</td>
    <td>
      <button type="button" class="btn btn-warning" (click)="update(n.newsid)">修改</button>
      <button type="button" class="btn btn-danger" (click)="delete(n.newsid)">删除</button>
    </td>
  </tr>
  <tr>
    <td colspan="4">
      <ngb-pagination
        [(page)]="page"
        [pageSize]="pagesize"
        [collectionSize]="total"(pageChange)="onPageChange($event)"[boundaryLinks]="true"></ngb-pagination>

    </td>


  </tr>

  </tbody>
</table>
